<?php
namespace BP\Sys\FrmUI;
require_once("BP/En/Map.php");
class SFTableClass extends EntityNoName {
	public function getHisUAC () 
	{
		$uac = new UAC();
		$uac->OpenForSysAdmin();
		$uac->IsInsert =  FALSE ;
		return $uac;
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_SFTable", "字典�?");
		$map->Java_SetDepositaryOfEntity($Depositary->None);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->Java_SetEnType($EnType->Sys);
		$map->AddTBStringPK(SFTableAttr::$No, NULL, "表英文名�?",  TRUE ,  FALSE , 1, 200, 20);
		$map->AddTBString(SFTableAttr::$Name, NULL, "表中文名�?",  TRUE ,  FALSE , 0, 200, 20);
		$map->AddDDLSysEnum(SFTableAttr::$SrcType, 0, "数据表类�?",  TRUE ,  TRUE , SFTableAttr::$SrcType, "@0=本地的类@1=创建表@2=表或视图@3=SQL查询表@4=WebServices");
		$map->AddDDLSysEnum(SFTableAttr::$CodeStruct, 0, "字典表类�?",  TRUE ,  FALSE , SFTableAttr::$CodeStruct);
		$map->AddTBString(SFTableAttr::$FK_Val, NULL, "默认创建的字段名",  TRUE ,  FALSE , 0, 200, 20);
		$map->AddTBString(SFTableAttr::$TableDesc, NULL, "表描�?",  TRUE ,  FALSE , 0, 200, 20);
		$map->AddTBString(SFTableAttr::$DefVal, NULL, "默认�?",  TRUE ,  FALSE , 0, 200, 20);
		$map->AddDDLEntities(SFTableAttr::$FK_SFDBSrc, "local", "数据�?", SFDBSrcs::constructor__(),  TRUE );
		$map->AddTBString(SFTableAttr::$SrcTable, NULL, "数据源表",  FALSE ,  FALSE , 0, 200, 20);
		$map->AddTBString(SFTableAttr::$ColumnValue, NULL, "显示的�??(编号�?)",  FALSE ,  FALSE , 0, 200, 20);
		$map->AddTBString(SFTableAttr::$ColumnText, NULL, "显示的文�?(名称�?)",  FALSE ,  FALSE , 0, 200, 20);
		$map->AddTBString(SFTableAttr::$ParentValue, NULL, "父级�?(父级�?)",  FALSE ,  FALSE , 0, 200, 20);
		$map->AddTBString(SFTableAttr::$SelectStatement, NULL, "查询语句",  FALSE ,  FALSE , 0, 1000, 600,  TRUE );
		$map->AddTBDateTime(SFTableAttr::$RDT, NULL, "加入日期",  FALSE ,  FALSE );
		$rm = new RefMethod();
		$rm->Title = "查看数据";
		$rm->ClassMethodName = ($this . ".DoEdit");
		$rm->refMethodType = $RefMethodType->RightFrameOpen;
		$rm->IsForEns =  FALSE ;
		$map->AddRefMethod($rm);
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	public function DoEdit () 
	{
		return ((SystemConfig::getCCFlowWebPath() . "WF/Comm/Ens.htm?EnsName=") . $this->getNo());
	}
	protected function beforeDelete () 
	{
		$sf = SFTable::constructor__String($this->getNo());
		$sf->Delete();
		return parent->beforeDelete();
	}
	protected function beforeInsert () 
	{
		$this->SetValByKey("RDT", $DataType->getCurrentDataTime());
		return parent->beforeInsert();
	}
}
?>
